{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\" \n",
    "\n",
    "# 解决坐标轴刻度负号乱码\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "\n",
    "# 解决中文乱码问题\n",
    "plt.rcParams['font.sans-serif'] = ['Simhei']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>12669</td>\n",
       "      <td>9656</td>\n",
       "      <td>7561</td>\n",
       "      <td>214</td>\n",
       "      <td>2674</td>\n",
       "      <td>1338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>7057</td>\n",
       "      <td>9810</td>\n",
       "      <td>9568</td>\n",
       "      <td>1762</td>\n",
       "      <td>3293</td>\n",
       "      <td>1776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>6353</td>\n",
       "      <td>8808</td>\n",
       "      <td>7684</td>\n",
       "      <td>2405</td>\n",
       "      <td>3516</td>\n",
       "      <td>7844</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>13265</td>\n",
       "      <td>1196</td>\n",
       "      <td>4221</td>\n",
       "      <td>6404</td>\n",
       "      <td>507</td>\n",
       "      <td>1788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>22615</td>\n",
       "      <td>5410</td>\n",
       "      <td>7198</td>\n",
       "      <td>3915</td>\n",
       "      <td>1777</td>\n",
       "      <td>5185</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Channel  Region  Fresh  Milk  Grocery  Frozen  Detergents_Paper  Delicassen\n",
       "0        2       3  12669  9656     7561     214              2674        1338\n",
       "1        2       3   7057  9810     9568    1762              3293        1776\n",
       "2        2       3   6353  8808     7684    2405              3516        7844\n",
       "3        1       3  13265  1196     4221    6404               507        1788\n",
       "4        2       3  22615  5410     7198    3915              1777        5185"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_csv(r\"Wholesale customers data.csv\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 440 entries, 0 to 439\n",
      "Data columns (total 8 columns):\n",
      " #   Column            Non-Null Count  Dtype\n",
      "---  ------            --------------  -----\n",
      " 0   Channel           440 non-null    int64\n",
      " 1   Region            440 non-null    int64\n",
      " 2   Fresh             440 non-null    int64\n",
      " 3   Milk              440 non-null    int64\n",
      " 4   Grocery           440 non-null    int64\n",
      " 5   Frozen            440 non-null    int64\n",
      " 6   Detergents_Paper  440 non-null    int64\n",
      " 7   Delicassen        440 non-null    int64\n",
      "dtypes: int64(8)\n",
      "memory usage: 27.6 KB\n"
     ]
    }
   ],
   "source": [
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.322727</td>\n",
       "      <td>2.543182</td>\n",
       "      <td>12000.297727</td>\n",
       "      <td>5796.265909</td>\n",
       "      <td>7951.277273</td>\n",
       "      <td>3071.931818</td>\n",
       "      <td>2881.493182</td>\n",
       "      <td>1524.870455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.468052</td>\n",
       "      <td>0.774272</td>\n",
       "      <td>12647.328865</td>\n",
       "      <td>7380.377175</td>\n",
       "      <td>9503.162829</td>\n",
       "      <td>4854.673333</td>\n",
       "      <td>4767.854448</td>\n",
       "      <td>2820.105937</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>55.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>25.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>3127.750000</td>\n",
       "      <td>1533.000000</td>\n",
       "      <td>2153.000000</td>\n",
       "      <td>742.250000</td>\n",
       "      <td>256.750000</td>\n",
       "      <td>408.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>8504.000000</td>\n",
       "      <td>3627.000000</td>\n",
       "      <td>4755.500000</td>\n",
       "      <td>1526.000000</td>\n",
       "      <td>816.500000</td>\n",
       "      <td>965.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>16933.750000</td>\n",
       "      <td>7190.250000</td>\n",
       "      <td>10655.750000</td>\n",
       "      <td>3554.250000</td>\n",
       "      <td>3922.000000</td>\n",
       "      <td>1820.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>112151.000000</td>\n",
       "      <td>73498.000000</td>\n",
       "      <td>92780.000000</td>\n",
       "      <td>60869.000000</td>\n",
       "      <td>40827.000000</td>\n",
       "      <td>47943.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Channel      Region          Fresh          Milk       Grocery  \\\n",
       "count  440.000000  440.000000     440.000000    440.000000    440.000000   \n",
       "mean     1.322727    2.543182   12000.297727   5796.265909   7951.277273   \n",
       "std      0.468052    0.774272   12647.328865   7380.377175   9503.162829   \n",
       "min      1.000000    1.000000       3.000000     55.000000      3.000000   \n",
       "25%      1.000000    2.000000    3127.750000   1533.000000   2153.000000   \n",
       "50%      1.000000    3.000000    8504.000000   3627.000000   4755.500000   \n",
       "75%      2.000000    3.000000   16933.750000   7190.250000  10655.750000   \n",
       "max      2.000000    3.000000  112151.000000  73498.000000  92780.000000   \n",
       "\n",
       "             Frozen  Detergents_Paper    Delicassen  \n",
       "count    440.000000        440.000000    440.000000  \n",
       "mean    3071.931818       2881.493182   1524.870455  \n",
       "std     4854.673333       4767.854448   2820.105937  \n",
       "min       25.000000          3.000000      3.000000  \n",
       "25%      742.250000        256.750000    408.250000  \n",
       "50%     1526.000000        816.500000    965.500000  \n",
       "75%     3554.250000       3922.000000   1820.250000  \n",
       "max    60869.000000      40827.000000  47943.000000  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import Normalizer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.70833271, 0.53987376, 0.42274083, 0.01196489, 0.14950522,\n",
       "        0.07480852],\n",
       "       [0.44219826, 0.61470384, 0.59953989, 0.11040858, 0.20634248,\n",
       "        0.11128583],\n",
       "       [0.39655169, 0.5497918 , 0.47963217, 0.15011913, 0.2194673 ,\n",
       "        0.48961931],\n",
       "       ...,\n",
       "       [0.36446153, 0.38846468, 0.7585445 , 0.01096068, 0.37223685,\n",
       "        0.04682745],\n",
       "       [0.93773743, 0.1805304 , 0.20340427, 0.09459392, 0.01531   ,\n",
       "        0.19365326],\n",
       "       [0.67229603, 0.40960124, 0.60547651, 0.01567967, 0.11506466,\n",
       "        0.01254374]])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1=Normalizer().fit_transform(data[['Fresh','Milk','Grocery','Frozen','Detergents_Paper','Delicassen']])\n",
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.708333</td>\n",
       "      <td>0.539874</td>\n",
       "      <td>0.422741</td>\n",
       "      <td>0.011965</td>\n",
       "      <td>0.149505</td>\n",
       "      <td>0.074809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.442198</td>\n",
       "      <td>0.614704</td>\n",
       "      <td>0.599540</td>\n",
       "      <td>0.110409</td>\n",
       "      <td>0.206342</td>\n",
       "      <td>0.111286</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.396552</td>\n",
       "      <td>0.549792</td>\n",
       "      <td>0.479632</td>\n",
       "      <td>0.150119</td>\n",
       "      <td>0.219467</td>\n",
       "      <td>0.489619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.856837</td>\n",
       "      <td>0.077254</td>\n",
       "      <td>0.272650</td>\n",
       "      <td>0.413659</td>\n",
       "      <td>0.032749</td>\n",
       "      <td>0.115494</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.895416</td>\n",
       "      <td>0.214203</td>\n",
       "      <td>0.284997</td>\n",
       "      <td>0.155010</td>\n",
       "      <td>0.070358</td>\n",
       "      <td>0.205294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>435</th>\n",
       "      <td>0.776890</td>\n",
       "      <td>0.315197</td>\n",
       "      <td>0.419191</td>\n",
       "      <td>0.343549</td>\n",
       "      <td>0.004760</td>\n",
       "      <td>0.057646</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>436</th>\n",
       "      <td>0.990872</td>\n",
       "      <td>0.036146</td>\n",
       "      <td>0.019298</td>\n",
       "      <td>0.113919</td>\n",
       "      <td>0.002349</td>\n",
       "      <td>0.059258</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>437</th>\n",
       "      <td>0.364462</td>\n",
       "      <td>0.388465</td>\n",
       "      <td>0.758545</td>\n",
       "      <td>0.010961</td>\n",
       "      <td>0.372237</td>\n",
       "      <td>0.046827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>438</th>\n",
       "      <td>0.937737</td>\n",
       "      <td>0.180530</td>\n",
       "      <td>0.203404</td>\n",
       "      <td>0.094594</td>\n",
       "      <td>0.015310</td>\n",
       "      <td>0.193653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>439</th>\n",
       "      <td>0.672296</td>\n",
       "      <td>0.409601</td>\n",
       "      <td>0.605477</td>\n",
       "      <td>0.015680</td>\n",
       "      <td>0.115065</td>\n",
       "      <td>0.012544</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>440 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Fresh      Milk   Grocery    Frozen  Detergents_Paper  Delicassen\n",
       "0    0.708333  0.539874  0.422741  0.011965          0.149505    0.074809\n",
       "1    0.442198  0.614704  0.599540  0.110409          0.206342    0.111286\n",
       "2    0.396552  0.549792  0.479632  0.150119          0.219467    0.489619\n",
       "3    0.856837  0.077254  0.272650  0.413659          0.032749    0.115494\n",
       "4    0.895416  0.214203  0.284997  0.155010          0.070358    0.205294\n",
       "..        ...       ...       ...       ...               ...         ...\n",
       "435  0.776890  0.315197  0.419191  0.343549          0.004760    0.057646\n",
       "436  0.990872  0.036146  0.019298  0.113919          0.002349    0.059258\n",
       "437  0.364462  0.388465  0.758545  0.010961          0.372237    0.046827\n",
       "438  0.937737  0.180530  0.203404  0.094594          0.015310    0.193653\n",
       "439  0.672296  0.409601  0.605477  0.015680          0.115065    0.012544\n",
       "\n",
       "[440 rows x 6 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2 = pd.DataFrame(data1,columns=['Fresh','Milk','Grocery','Frozen','Detergents_Paper','Delicassen'])\n",
    "data2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 适用轮廓系数找到最优K"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.cluster import KMeans \n",
    "from sklearn.metrics import silhouette_score #轮廓系数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.4478262043812748"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cluster = KMeans(n_clusters=3, random_state=0).fit(data2)\n",
    "silhouette_score(data2,cluster.labels_)          "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x19fab3fa9d0>]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD2CAYAAADcUJy6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAfKUlEQVR4nO3deXiV9Zn/8fedBQgQshGDbLK6IQJ62ALa1ErH1ioFq9K61IXiEnV+Y3/XTzrDOLa102XUGSuhSsF9qbii3RyVUoUQJREBF1BARNBICIQQdsj9+yOHQGOWk+QkZ8nndV25rodzvs8595cHPjw85/4+x9wdERGJPwmRLkBERNqGAl5EJE4p4EVE4pQCXkQkTingRUTiVFKkCziiZ8+ePmDAgEiXISISU0pKSra5e3Z9z0VNwA8YMIDi4uJIlyEiElPM7NOGntMlGhGROKWAFxGJUwp4EZE4pYAXEYlTCngRkTilgBcRiVMKeBGROBVSwJvZfDMrNLNZDTyfZGabzGxx8Gd48PGfmtlyM5sdzqKPte/gYe546X227z7QVm8hIhKTmgx4M5sKJLp7LtDbzIbWM+x04Cl3zwv+rDazADARGANsNrNzw1p50KrNO3ny7U1cOHsJa0or2+ItRERiUihn8HnAguD2ImpCu65xwBQz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lDg7hWNjImVYxLKXGLhmEBodYb1uETrQf2K4L/kC4CfuHtDNyUr4eh/NUcAG9uhtGYLcS6PmdkIM0sEpgAr263AZjCz28zsyuAv06k5M6krVo5LKHOJheNyLpBvZouBkWY2r54xMXFMCG0usXBMILQ6w3tc3D0mfoAbgB3A4uDPfwB31hnTI/ibdg/wIZAW6bpbMZfTgFXAauAXka65kblkAK8CbwBzqPmgMlaPSyhziYnjcky9i4FTY/WYhDiXmDgmdesEMoF5dcYkAEuBe4G1wMDWvGfcrWQ1swxgEvCGuzf0oYy0Mx2X6KNjEp3MLAU4H3jH3Te06rXiLeBFRKRGzFyDFxGR5lHAi4jEKQW8iEicUsCLiMQpBbyISJz6/6S2xP1oZGMSAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "score=[]\n",
    "\n",
    "for i in range(2,6):\n",
    "    cluster= KMeans(n_clusters=i, random_state=0).fit(data2)\n",
    "    score.append(silhouette_score(data2,cluster.labels_))\n",
    "                 \n",
    "plt.plot(range(2,6),score)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建模及可视化分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "cluster = KMeans(n_clusters=3, random_state=0).fit(data2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.57508847, 0.23324504, 0.27925177, 0.6254248 , 0.05374771,\n",
       "        0.10905186],\n",
       "       [0.9024623 , 0.17915962, 0.22911268, 0.14969506, 0.04904731,\n",
       "        0.07445492],\n",
       "       [0.25411803, 0.48606066, 0.68466474, 0.09572091, 0.27138443,\n",
       "        0.09719618]])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centroid = cluster.cluster_centers_\n",
    "centroid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.575088</td>\n",
       "      <td>0.233245</td>\n",
       "      <td>0.279252</td>\n",
       "      <td>0.625425</td>\n",
       "      <td>0.053748</td>\n",
       "      <td>0.109052</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.902462</td>\n",
       "      <td>0.179160</td>\n",
       "      <td>0.229113</td>\n",
       "      <td>0.149695</td>\n",
       "      <td>0.049047</td>\n",
       "      <td>0.074455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.254118</td>\n",
       "      <td>0.486061</td>\n",
       "      <td>0.684665</td>\n",
       "      <td>0.095721</td>\n",
       "      <td>0.271384</td>\n",
       "      <td>0.097196</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3         4         5\n",
       "0  0.575088  0.233245  0.279252  0.625425  0.053748  0.109052\n",
       "1  0.902462  0.179160  0.229113  0.149695  0.049047  0.074455\n",
       "2  0.254118  0.486061  0.684665  0.095721  0.271384  0.097196"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "C = pd.DataFrame(centroid)\n",
    "C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "      <th>pred</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.708333</td>\n",
       "      <td>0.539874</td>\n",
       "      <td>0.422741</td>\n",
       "      <td>0.011965</td>\n",
       "      <td>0.149505</td>\n",
       "      <td>0.074809</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.442198</td>\n",
       "      <td>0.614704</td>\n",
       "      <td>0.599540</td>\n",
       "      <td>0.110409</td>\n",
       "      <td>0.206342</td>\n",
       "      <td>0.111286</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.396552</td>\n",
       "      <td>0.549792</td>\n",
       "      <td>0.479632</td>\n",
       "      <td>0.150119</td>\n",
       "      <td>0.219467</td>\n",
       "      <td>0.489619</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.856837</td>\n",
       "      <td>0.077254</td>\n",
       "      <td>0.272650</td>\n",
       "      <td>0.413659</td>\n",
       "      <td>0.032749</td>\n",
       "      <td>0.115494</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.895416</td>\n",
       "      <td>0.214203</td>\n",
       "      <td>0.284997</td>\n",
       "      <td>0.155010</td>\n",
       "      <td>0.070358</td>\n",
       "      <td>0.205294</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Fresh      Milk   Grocery    Frozen  Detergents_Paper  Delicassen  pred\n",
       "0  0.708333  0.539874  0.422741  0.011965          0.149505    0.074809     1\n",
       "1  0.442198  0.614704  0.599540  0.110409          0.206342    0.111286     2\n",
       "2  0.396552  0.549792  0.479632  0.150119          0.219467    0.489619     2\n",
       "3  0.856837  0.077254  0.272650  0.413659          0.032749    0.115494     1\n",
       "4  0.895416  0.214203  0.284997  0.155010          0.070358    0.205294     1"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2[\"pred\"] = cluster.predict(data2)\n",
    "data2.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    214\n",
       "2    173\n",
       "0     53\n",
       "Name: pred, dtype: int64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = data2[\"pred\"].value_counts()\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "([<matplotlib.patches.Wedge at 0x19fab3e6bb0>,\n",
       "  <matplotlib.patches.Wedge at 0x19faaf344c0>,\n",
       "  <matplotlib.patches.Wedge at 0x19fab3d0460>],\n",
       " [Text(0.04710943215195195, 1.098990764930407, ''),\n",
       "  Text(-0.44980057306511145, -1.003832378672006, ''),\n",
       "  Text(1.0221749042439292, -0.4063969305173383, '')],\n",
       " [Text(0.0256960539010647, 0.5994495081438582, '48.64%'),\n",
       "  Text(-0.2453457671264244, -0.5475449338210941, '39.32%'),\n",
       "  Text(0.5575499477694159, -0.22167105300945722, '12.05%')])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x19fab3fce20>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAbuUlEQVR4nO3de3hcVb3/8fdcck86SZpJL7S420ILBSy0XIoghVPAU3LOgSLgQ1EjCnpEPQIqbh70MIgcgsjxwYOXn3CEchUBRcs+FCzlIlQuBqhTEIpt0zZJk6ZpOklmkslc9u+PnUIJSZt0LmvNzPf1PPOUB7L3+obmk7X23mut7bJtGyGEftyqCxBCjE7CKYSmJJxCaErCKYSmJJxCaErCKYSmJJxCaErCKYSmJJxCaErCKYSmvKoLECJdmpub671e713A0ejX8SSBDfF4/LJFixbtHM8BEk6RN7xe711Tp0490u/397jdbq0mjSeTSVdXV9f8jo6Ou4B/G88xuv12ESIVR/v9/l7dggngdrttv98fwunVx3dMBusRItvcOgZzr+Haxp05GdaKvGWY1qJ0nq+lqaE5nec7EOk5hdCUhFOINLrooos+dtxxxx1xzTXXTEv1XBJOIdJk5cqV1YlEwvXGG2+8097eXhQMBktSOZ+EU4g0efbZZ6suuuiiHoClS5f2rV27tjKV80k4hUiTSCTiPvTQQ4cAfD5forOzsyiV80k4hUiTioqKZCQScQP09fW5k8lkSueTRykib2X70ceiRYsizz//fOXSpUvDb775Zvm8efMGUzmfhFOINFmxYkXPySeffER7e3vR2rVrfa+99to7qZxPhrVCpEltbW3yxRdffHfx4sXh55577t3JkycnUjmf9JxCpJHf709cdtllPek4l/ScQmhKwimEpmRYqznDtKYA84C5wExg0j6fqhH/XA7EgejwZxDoA0L7fFqBfwx/3mtpaujN4reTXQFfWie+Ewhl9e6vhFMThmkdDizECeHeMM4FfBludxcfhHUTsB74c0tTw65Mtpuvtm/f7j3vvPPmNDc3v5vquSScihimNRc4ffizBJiuqJS64c/iff+lYVp/B/6899PS1LBVQW05paury7NixYpZAwMDablclHBmiWFaM4Fz+CCMKa9ayLAjhz9fBjBMaxtOUJ8C/pDXw+GD5PF47Mcff3zzsmXLDkvH+SScGWSY1mTgQmAFcCrgUltRSg4FLhn+RA3TehL4DbCqpakhorQyTdTW1qY2X28ECWeaGaZVDpyLE8hPASlNftZUCXDe8CdsmNYTOEF9sqWpIaqwrrwi4UwTw7QWA1/H+YGtUFtNVlUAnxn+hAzTuhf4SUtTwxa1ZeU+CWcKDNNy4VxHfhf4pOJydOADvgFcYZjW74AftzQ1vKqsmiw/+kg3CedBMEyrCLgY+A4T2OqwgHhwrrUvNEzrReDHwB9bmhq03RkvnV599dWUH6OAhHNCDNOqAC4HrsaZECAO7NThz0bDtG4F7m5pakhpQnihkOl742CYlsswrUtxHtL/BAnmwZgL3Am8YZjWP6kuJhdIOA/AMK0TgZeBXwNTFJeTD44BnjFM63HDtNLyPDBfybB2DIZpTQWagM+T288ndXUusMwwrZ8CN8qkho+ScI4wfLPnm8D3cSaUi8wpBr4NfN4wretamhruSufJj1l5TFonvgcbgzLxXRXDtBYADwLzVddSYOqBOw3TOh+4tKWpoVN1QQeju7vbs3z58tnxeJyKiorkqlWrNpeWlh70HWq55hxmmNY3gVeQYKq0DAgapjWuV+Tp5s4776y96qqrOtetW/defX197LHHHktp5FXwPadhWvXA3TiTC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DOM8c9wGbB3xZ6vM1tGPhDNfBHxenJB6gDCBUExxRSJFEk4hNCXrOYXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQlIRTCE1JOIXQ1P8HWzz4pTAOgRAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.pie(a,autopct='%0.2f%%')\n",
    "plt.legend(['0','1','2'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pred</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>30.479689</td>\n",
       "      <td>12.361987</td>\n",
       "      <td>14.800344</td>\n",
       "      <td>33.147515</td>\n",
       "      <td>2.848629</td>\n",
       "      <td>5.779748</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>193.126933</td>\n",
       "      <td>38.340159</td>\n",
       "      <td>49.030113</td>\n",
       "      <td>32.034743</td>\n",
       "      <td>10.496124</td>\n",
       "      <td>15.933354</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>43.962420</td>\n",
       "      <td>84.088494</td>\n",
       "      <td>118.447000</td>\n",
       "      <td>16.559717</td>\n",
       "      <td>46.949506</td>\n",
       "      <td>16.814940</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Fresh       Milk     Grocery     Frozen  Detergents_Paper  \\\n",
       "pred                                                                   \n",
       "0      30.479689  12.361987   14.800344  33.147515          2.848629   \n",
       "1     193.126933  38.340159   49.030113  32.034743         10.496124   \n",
       "2      43.962420  84.088494  118.447000  16.559717         46.949506   \n",
       "\n",
       "      Delicassen  \n",
       "pred              \n",
       "0       5.779748  \n",
       "1      15.933354  \n",
       "2      16.814940  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data3 = data2.groupby(\"pred\").sum()\n",
    "data3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='pred'>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAEACAYAAABBDJb9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAbvUlEQVR4nO3de3RU9fnv8fcjYKMgojRCLUaQA4EfgYimcoeBqkgFrYALFBoGRbyVlp7fsUCpy2BB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27cWGW/iy++mN69v13lfM455/CXv/yFMWPG8POf//yo+06YMAE4emXFYcOGceDAAS666CLWr1/PCSdUnw4PTbPMnz+fZs2a0bRpU+bOncukSZPYu3dveb/zzz8fgB49elBcXMzGjRt55plniEQifPrpp+WVHytXkgyCpllEQipdSwl37drFkiVLGDp0KNOmTWPw4MH86U9/4vTTTwfgpJNOYv/+/QC4O9nZ2Vx++eWH9SsrKzui2uJzzz3HI488Qs+ePcvbqtoXqq6sWPm8b731Fj/5yU/o3bs3/fr1IxqN0rFjx6Su8Xe/+x0zZswgNzeXHj16lLe//fbbZGdn88477zB27Fj+8Y9/cMEFFzBx4kRefPHF8sqPla8tCBqZi0hgpkyZwiWXXMJdd93FwoUL+e1vf0u/fv1YunQpbdrESzaNGjWKuXPn0rt3bz755BOmT59eZb/Kzj//fEaNGsUPf/hD8vPz2bx5c9L7VnXejh078stf/pI+ffpwxhlncPbZZyd9ncOHD+eGG27gsssu4+STTy4fcb/44ov069ePLl26kJuby3XXXceSJUsYOHAgDz74IGeddVYtfpu1U2PVxLqgqolSG6qamJywV00sKCjgzTffpEmTJjRt2pS77rqLbt26pTusctFolIKCAtq3bx/I8WpbNVHTLCLSIBQUFNTp8bdt28bYsWMPa8vOzk5qlQvAwoUL6yCq5CmZi4gAbdu2JRaLpTuMlGnOXEQkBJTMRURCQNMsIiF1z5jhgR7vP598MdDjSbA0MheRQCRbaAvij7NXtG3bNubOnVuH0YWfRuYiEph58+bRtWtXcnNz6dWr12EP1BxN27ZtmT59eh1HF24amYtIoCoW2ho2bBh9+/blzjvvPOo+xcXFRKPR8veff/45w4cPp0+fPkyYMIGDBw+yZcsWIpEIgwYNYubMmQDs2LGDwYMH079/f66//vpq27Zv335ELNFolNtvv50BAwbQt29fvvrqqzr4bdQfJXMRCVx1hbaSdccddzBu3DjeeustunXrxqZNm6osblVVsayq2pItyNWQKZmLSOBqU2irKhs2bOCCCy4A4JZbbqF9+/ZVFreqqlhWVW3HUpCroUgqmZtZGzNbmXid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cvfK5QueMbNTgIHAX9IQkyTBzFYAJxP/I1zeDHhjSwYNVAt3HwVgZn2Ap81sRppjSguNzANgZg8Tn1p5CthM/EnYAcB4INLIl2ke18ysDbAQGJNYXisNiJm9DNzj7q8l3p8OPEm8nEjrtAZXz5TMA2JmVxBfZ9+ceGmDdcCzmjM//plZK+Df7r4v3bFI7ZhZS2Ccu8+v0NYMuNbdH0xfZPVPyVxEJAS0NFFEJASUzEVEQkDJXKQWzCxqZtF0xyFSmZK5iEgIaJ25NBpmVgD0Ir6uvBQYC7wKPEf8YZMeZmbEK+91TvQZw7fLTlsBZcBj9R27SE00MpfGZqW7DyL+1ODlwPeIPyDUI7H9cqBZos//Ay4FRgKb3H0wsCkNMYvUSCNzaWzWJf5dD7QHdgO/r7A9G+hjZjHiZRk+Alon+gMU1UuUIrWkkbk0Nhck/u0JfAzsd/eDFbZvBJ5w9wgwFfiQ+Gj8PyrsJ3LcUTKXxuYHiVF3K+CFKrY/D5xpZm8As4kn8qeBzon9OtdPmCK1oydApdFI3ACNuXsszaGIBE7JXEQkBDTNIiISAkrmIiIhoGQuIhICSuYiIiGgZC4iEgJK5iIiIfD/AQsGzXm4r4Z3AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "data3.plot.bar()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
